add_executable(trial_gtest googletest.cpp)

if(${THIRD_PARTY_MODE} STREQUAL "git submodule")
  target_include_directories(trial_gtest PRIVATE ${CMAKE_SOURCE_DIR}/third_party/googletest/googletest/include)
  target_link_libraries(trial_gtest gtest gtest_main)
elseif(${THIRD_PARTY_MODE} STREQUAL "conan2")
  find_package(GTest REQUIRED)
  target_link_libraries(trial_gtest GTest::gtest GTest::gtest_main)
elseif(${THIRD_PARTY_MODE} STREQUAL "cmake fetch content")
  include(${CMAKE_SOURCE_DIR}/cmake/fetch_content_googletest.cmake)
  find_package(GTest)
  target_link_libraries(trial_gtest GTest::gtest GTest::gtest_main)
endif()

# auto find gtest in trial_gtest
gtest_discover_tests(trial_gtest)
